//package com.leo.test.springbootdemo;
//
//import org.redisson.Config;
//import org.redisson.RedissonClient;
//import org.redisson.SingleServerConfig;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//@Configuration
//public class BeanConfig {
//    @Value("${spring.redis.host}")
//    String host;
//
//    @Value("${spring.redis.password}")
//    String password;
//
//    @Value("${spring.redis.port}")
//    String port;
//
//    @Bean
//    public RedissonClient redissonClient(){
//        Config config = new Config();
//        SingleServerConfig singleServerConfig = config.useSingleServer();
//        singleServerConfig.setAddress(host+":"+port);
//        singleServerConfig.setPassword(password);
//        singleServerConfig.setConnectionMinimumIdleSize(2);
//        singleServerConfig.setConnectionPoolSize(3);
//        singleServerConfig.setSubscriptionConnectionPoolSize(3);
//        singleServerConfig.setSubscriptionConnectionMinimumIdleSize(1);
//        return RedissionUtil.getInstance().getRedisson(config);
//    }
//}
